package com.bjsxt.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bjsxt.domain.Menu;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.List;

/**
 * @author Administrator
 * @title: MenuMapper
 * @projectName open-his
 * @description: TODO
 * @date 2020/12/29 0029
 */
public interface MenuMapper extends BaseMapper<Menu> {
    /**
     * 根据菜单id查询子节点个数
     *
     * @param menuId
     * @return
     */
    Long queryChildCountByMenuId(Long menuId);

    /**
     * 根据角色id查询菜单和权限id数据
     *
     * @param roleId
     * @return
     */
    List<Long> queryMenuIdsByRoleId(Long roleId);

    /**
     * 根据用户id查询用户拥有的菜单信息
     *
     * @param userId
     * @return
     */
    List<Menu> selectMenuListByUserId(@Param("userId") Serializable userId);

}